<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<meta name="decorator" content="default"/>
<script type="text/javascript">
    function page(n,s){
        $("#pageNo").val(n);
        $("#pageSize").val(s);
        $("#searchForm").submit();
        return false;
    }
    window.onload=function(){
        var tableObj = document.getElementById("contentTable");
        for (var i = 1; i < tableObj.rows.length; i++) {
//            for (var j = 0; j < tableObj.rows[i].cells.length; j++) {
                var result= tableObj.rows[i].cells[4].innerText;
                var printContext = tableObj.rows[i].cells[7].innerText;
                var printContextPre = printContext.substr(0, printContext.indexOf('-'));
                var printContextEnd = printContext.substr(printContext.lastIndexOf('-')+1,printContext.length);
                if(parseFloat(printContextPre)> parseFloat(result)){
                    tableObj.rows[i].cells[4].innerHTML="<span style='color:chocolate'>" + result +"</span>"
                }else if(parseFloat(printContextPre)< parseFloat(result) &&  parseFloat(result)<parseFloat(printContextEnd)){
                    tableObj.rows[i].cells[4].innerHTML="<span style='color:green'>" + result +"</span>"
                }else if(parseFloat(printContextEnd)<parseFloat(result)){
                    tableObj.rows[i].cells[4].innerHTML="<span style='color:red'>" + result +"</span>"
                }
//            }
        }
    }

</script>
<div class="content-wrap">
    <div class="wrapper" style="bottom: 50px;">
        <section class="panel panel-default">
                <div class="table-responsive no-border">
                    <table id="contentTable" class="table table-bordered table-striped mg-t datatable">
                        <thead>
                        <tr>
                            <th>序号</th>
                            <th>申请单号</th>
                            <%--<th>print_order</th>//--%>
                            <th>检验项目</th>
                            <th>检验代码</th>
                            <th>检验结果</th>
                            <th>检验单位</th>
                            <%--<th>abnormal_indicator</th>--%>
                            <%--<th>instrument_id</th>--%>
                            <th>报告时间</th>
                            <th>结果范围</th>
                            <%--<th>result_range</th>--%>
                            <%--<th>操作</th>--%>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${page.list}" var="labResult" varStatus="index">
                            <tr>
                                <td> ${labResult.itemNo}</td>
                                <td> ${labResult.testNo}</td>
                                <%--<td> ${labResult.printOrder}</td>--%>
                                <td> ${labResult.reportItemName}</td>
                                <td> ${labResult.reportItemCode}</td>
                                <td> ${labResult.result}</td>
                                <td> ${labResult.units}</td>
                                <%--<td> ${labResult.abnormalIndicator}</td>--%>
                                <%--<td> ${labResult.instrumentId}</td>--%>
                                <td><fmt:formatDate value="${labResult.resultDateTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                                <td> ${labResult.printContext}</td>
                                <%--<td> ${labResult.resultRange}</td>--%>
                                <%--<td>
                                    <a href="#" onclick="loadDiv('mainCenterDiv','${ctx}/doctor/lab/labResult/form?id=${labResult.id}')" class="btn btn-success btn-xs">修改</a>
                                    <a href="#"  class="applyBt btn btn-danger btn-xs" onclick="confirmExtend('确认要删除该吗？',function(){delLoad('mainCenterDiv','${ctx}/doctor/lab/labResult/delete?id=${labResult.id}','${ctx}/sys/dict/index')})">删除</a>
                                </td>--%>
                            </tr>
                        </c:forEach>

                    </table>
                    <%--<div class="pagination">${page}</div>--%>
                </div>
        </section>
        低于标准：<span style='color:chocolate'> —— </span>&nbsp;&nbsp;&nbsp;&nbsp;
        符合标准：<span style='color:green'> —— </span>&nbsp;&nbsp;&nbsp;&nbsp;
        高于标准：<span style='color:red'> —— </span>&nbsp;&nbsp;&nbsp;&nbsp;
    </div>
</div>